home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
mutt
/
tobase.mut
< prev
next >
Wrap
Text File
|
1988-09-23
|
410b
|
17 lines
; tobase(n,base): convert n (base 10) to base. eg (tobase 10 16) => A
; C Durland
(include mod.mut)
(defun
tobase (int n base) HIDDEN
{
(if (< n base) (substr "0123456789ABCDEF" n 1)
(concat
(tobase (/ n base) base) ; tobase n/base base
(tobase (mod n base) base) ; tobase (n mod base) base
)
)
}
)
;(msg (tobase (atoi (ask "n = "))(atoi (ask "base = "))))